// allow pasting
// ==UserScript==
// @name           Proboards Highlight Your Topics
// @namespace      http://glenncarr.com/greasemonkey/phpbb
// @description    Highlight topics you have created in a proboard board with the standard template
// @include        *freeforums.net/*
// @author         Glenn Carr (glenn at glenncarr dot com)
// @grant          GM_addStyle
// $LastChangedRevision$
// $LastChangedDate$
// ==/UserScript==
/*
    Updates:
*/

(function() {

var logout = document.evaluate( '//p[@id="welcome"]/span', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
if ( logout.snapshotLength == 0 )
    return;

var username = logout.snapshotItem( 0 ).innerHTML.replace( /Welcome\s+(.+)\.\s*/i, '$1' );

GM_addStyle( '.gncMyName { background: #ffa !important; color: maroon !important; font-weight: bold; }' );

var myTopics = document.evaluate( '//a[.="' + username + '"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for ( var i = 0; i < myTopics.snapshotLength; i++ )
{
    var nameLink = myTopics.snapshotItem( i );
    nameLink.setAttribute( "class", "gncMyName" );
}
    
})();